package  
{
	import ad.ui.ScrollList;
	import flash.events.Event;
	import library.buttons.UIButtonLK;
	
	import flash.display.Sprite;
	
	/**
	 * UIScrollList
	 * @version ActionScript 3.0
	 * @author Adrian C. Miranda
	 * @mail ad@adrianmiranda.com.br
	 */
	public class UIScrollList extends Sprite
	{
		private var list:ScrollList = new ScrollList();
		
		public function UIScrollList() 
		{
			if (stage) onAddedToStage();
			else addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
			addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
		}
		
		private function onAddedToStage(evt:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
			startScrollList();
		}
		
		private function onRemovedFromStage(evt:Event):void 
		{
			removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
			// Entry Point
		}
		
		private function startScrollList():void
		{
			list.addItem(new UIButtonLK());
			list.addItem(new UIButtonLK());
			list.addItem(new UIButtonLK());
			list.addItem(new UIButtonLK());
			addChild(list);
		}
		
	}

}